/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.upc.clase.demo.dao.impl;
import edu.upc.clase.demo.dao.ValoracionDao;
import edu.upc.clase.demo.entity.Valoracion;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport;
import org.springframework.stereotype.Repository;
/**
 *
 * @author rpalacios
 */
@Repository
public class ValoracionDaoImpl extends SimpleJdbcDaoSupport implements ValoracionDao{

    private static Logger log = LoggerFactory.getLogger(ValoracionDaoImpl.class); 
    
    @Autowired
    public ValoracionDaoImpl(DataSource dataSource) {
        log.info("Asignando el dataSource");
        setDataSource(dataSource);
    }    
    
    @Override
    public Integer insertar(Valoracion valoracion) {
        // obtener valoracion.getEntrada();
            //onbtener usu= entrada.getUsuario();
        //si (1 estrella)
        // usu.asignar(0.7)
        //si (2 estrella)
        // usu.asignar(0.9)
        
        
        //Usuario.grabar()
        //insertar valoracion en db
        
        return (1);
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    
}
